<template>
  <!-- 用户权限模块 -->
  <div>
    <!-- 用户模块头部区域 -->
    <heads
      @addTo="addTo"
      @querys="querys"
      :userdata="userdata"
      @userlistt="userlistt"
      :dick="dick"
      :query="queryx"
    ></heads>
    <!-- 模块列表渲染 -->
    <userlist :userlistv="list" :queryx="queryx"></userlist>
    <!-- 添加数据模块 -->
    <div class="add">
      <AddTo :dack="back" @cance="cance"></AddTo>
    </div>
  </div>
</template>
<script>
import userlist from "../components/user/list.vue";
import heads from "../components/user/heads.vue";
import AddTo from "../components/user/addTo.vue";
export default {
  components: { userlist, heads, AddTo },
  data() {
    return {
      back: false, //添加数据表单是否出现
      userdata: {},
      dick: false,
      list: false,
      queryx: "",
    };
  },
  mounted() {},
  methods: {
    addTo(data) {
      // 赋值
      this.back = data;
    },
    userlistt(a) {
      //重新获取列表

      this.list = !this.list;
    },
    // 请求发起
    cance(rem, data, list) {
      this.back = rem;
      if (data == 2) {
        this.dick = !this.dick;
        this.userdata.list = list;
        this.userdata.id = data;
      }
    },
    querys(a) {
      this.queryx = a;
      this.list = !this.list;
    },
  },
};
</script>
<style scoped>
.add {
  position: absolute;
  left: 55%;
  bottom: 46%;
}
</style>